/*
 * Copyright (C) 2015 Zhang Rui <bbcallen@gmail.com>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/*
 * https://github.com/Bilibili/jni4android
 * This file is automatically generated by jni4android, do not modify.
 */

#include "AudioStreamInfo.h"


typedef struct J4AC_ohos_media_audio_AudioStreamInfo__Builder {
    jclass id;

    jmethodID constructor_Builder;
    jmethodID method_encodingFormat;
    jmethodID method_sampleRate;
    jmethodID method_channelMask;
    jmethodID method_streamUsage;
    jmethodID method_audioStreamFlag;
    jmethodID method_build;
} J4AC_ohos_media_audio_AudioStreamInfo__Builder;
static J4AC_ohos_media_audio_AudioStreamInfo__Builder class_J4AC_ohos_media_audio_AudioStreamInfo__Builder;

typedef struct J4AC_ohos_media_audio_AudioStreamInfo {
    jclass id;

} J4AC_ohos_media_audio_AudioStreamInfo;
static J4AC_ohos_media_audio_AudioStreamInfo class_J4AC_ohos_media_audio_AudioStreamInfo;

jobject J4AC_ohos_media_audio_AudioStreamInfo__Builder__Builder(JNIEnv *env)
{
    return (*env)->NewObject(env, class_J4AC_ohos_media_audio_AudioStreamInfo__Builder.id, class_J4AC_ohos_media_audio_AudioStreamInfo__Builder.constructor_Builder);
}

jobject J4AC_ohos_media_audio_AudioStreamInfo__Builder__Builder__catchAll(JNIEnv *env)
{
    jobject ret_object = J4AC_ohos_media_audio_AudioStreamInfo__Builder__Builder(env);
    if (J4A_ExceptionCheck__catchAll(env) || !ret_object) {
        return NULL;
    }

    return ret_object;
}

jobject J4AC_ohos_media_audio_AudioStreamInfo__Builder__Builder__asGlobalRef__catchAll(JNIEnv *env)
{
    jobject ret_object   = NULL;
    jobject local_object = J4AC_ohos_media_audio_AudioStreamInfo__Builder__Builder__catchAll(env);
    if (J4A_ExceptionCheck__catchAll(env) || !local_object) {
        ret_object = NULL;
        goto fail;
    }

    ret_object = J4A_NewGlobalRef__catchAll(env, local_object);
    if (!ret_object) {
        ret_object = NULL;
        goto fail;
    }

fail:
    J4A_DeleteLocalRef__p(env, &local_object);
    return ret_object;
}

jobject J4AC_ohos_media_audio_AudioStreamInfo__Builder__encodingFormat(JNIEnv *env, jobject thiz, jobject inputEncodingFormat)
{
    return (*env)->CallObjectMethod(env, thiz, class_J4AC_ohos_media_audio_AudioStreamInfo__Builder.method_encodingFormat, inputEncodingFormat);
}

jobject J4AC_ohos_media_audio_AudioStreamInfo__Builder__encodingFormat__catchAll(JNIEnv *env, jobject thiz, jobject inputEncodingFormat)
{
    jobject ret_object = J4AC_ohos_media_audio_AudioStreamInfo__Builder__encodingFormat(env, thiz, inputEncodingFormat);
    if (J4A_ExceptionCheck__catchAll(env) || !ret_object) {
        return NULL;
    }

    return ret_object;
}

jobject J4AC_ohos_media_audio_AudioStreamInfo__Builder__encodingFormat__asGlobalRef__catchAll(JNIEnv *env, jobject thiz, jobject inputEncodingFormat)
{
    jobject ret_object   = NULL;
    jobject local_object = J4AC_ohos_media_audio_AudioStreamInfo__Builder__encodingFormat__catchAll(env, thiz, inputEncodingFormat);
    if (J4A_ExceptionCheck__catchAll(env) || !local_object) {
        ret_object = NULL;
        goto fail;
    }

    ret_object = J4A_NewGlobalRef__catchAll(env, local_object);
    if (!ret_object) {
        ret_object = NULL;
        goto fail;
    }

fail:
    J4A_DeleteLocalRef__p(env, &local_object);
    return ret_object;
}

jobject J4AC_ohos_media_audio_AudioStreamInfo__Builder__sampleRate(JNIEnv *env, jobject thiz, jint inputSampleRate)
{
    return (*env)->CallObjectMethod(env, thiz, class_J4AC_ohos_media_audio_AudioStreamInfo__Builder.method_sampleRate, inputSampleRate);
}

jobject J4AC_ohos_media_audio_AudioStreamInfo__Builder__sampleRate__catchAll(JNIEnv *env, jobject thiz, jint inputSampleRate)
{
    jobject ret_object = J4AC_ohos_media_audio_AudioStreamInfo__Builder__sampleRate(env, thiz, inputSampleRate);
    if (J4A_ExceptionCheck__catchAll(env) || !ret_object) {
        return NULL;
    }

    return ret_object;
}

jobject J4AC_ohos_media_audio_AudioStreamInfo__Builder__sampleRate__asGlobalRef__catchAll(JNIEnv *env, jobject thiz, jint inputSampleRate)
{
    jobject ret_object   = NULL;
    jobject local_object = J4AC_ohos_media_audio_AudioStreamInfo__Builder__sampleRate__catchAll(env, thiz, inputSampleRate);
    if (J4A_ExceptionCheck__catchAll(env) || !local_object) {
        ret_object = NULL;
        goto fail;
    }

    ret_object = J4A_NewGlobalRef__catchAll(env, local_object);
    if (!ret_object) {
        ret_object = NULL;
        goto fail;
    }

fail:
    J4A_DeleteLocalRef__p(env, &local_object);
    return ret_object;
}

jobject J4AC_ohos_media_audio_AudioStreamInfo__Builder__channelMask(JNIEnv *env, jobject thiz, jobject inputChannelMask)
{
    return (*env)->CallObjectMethod(env, thiz, class_J4AC_ohos_media_audio_AudioStreamInfo__Builder.method_channelMask, inputChannelMask);
}

jobject J4AC_ohos_media_audio_AudioStreamInfo__Builder__channelMask__catchAll(JNIEnv *env, jobject thiz, jobject inputChannelMask)
{
    jobject ret_object = J4AC_ohos_media_audio_AudioStreamInfo__Builder__channelMask(env, thiz, inputChannelMask);
    if (J4A_ExceptionCheck__catchAll(env) || !ret_object) {
        return NULL;
    }

    return ret_object;
}

jobject J4AC_ohos_media_audio_AudioStreamInfo__Builder__channelMask__asGlobalRef__catchAll(JNIEnv *env, jobject thiz, jobject inputChannelMask)
{
    jobject ret_object   = NULL;
    jobject local_object = J4AC_ohos_media_audio_AudioStreamInfo__Builder__channelMask__catchAll(env, thiz, inputChannelMask);
    if (J4A_ExceptionCheck__catchAll(env) || !local_object) {
        ret_object = NULL;
        goto fail;
    }

    ret_object = J4A_NewGlobalRef__catchAll(env, local_object);
    if (!ret_object) {
        ret_object = NULL;
        goto fail;
    }

fail:
    J4A_DeleteLocalRef__p(env, &local_object);
    return ret_object;
}

jobject J4AC_ohos_media_audio_AudioStreamInfo__Builder__streamUsage(JNIEnv *env, jobject thiz, jobject inputStreamUsage)
{
    return (*env)->CallObjectMethod(env, thiz, class_J4AC_ohos_media_audio_AudioStreamInfo__Builder.method_streamUsage, inputStreamUsage);
}

jobject J4AC_ohos_media_audio_AudioStreamInfo__Builder__streamUsage__catchAll(JNIEnv *env, jobject thiz, jobject inputStreamUsage)
{
    jobject ret_object = J4AC_ohos_media_audio_AudioStreamInfo__Builder__streamUsage(env, thiz, inputStreamUsage);
    if (J4A_ExceptionCheck__catchAll(env) || !ret_object) {
        return NULL;
    }

    return ret_object;
}

jobject J4AC_ohos_media_audio_AudioStreamInfo__Builder__streamUsage__asGlobalRef__catchAll(JNIEnv *env, jobject thiz, jobject inputStreamUsage)
{
    jobject ret_object   = NULL;
    jobject local_object = J4AC_ohos_media_audio_AudioStreamInfo__Builder__streamUsage__catchAll(env, thiz, inputStreamUsage);
    if (J4A_ExceptionCheck__catchAll(env) || !local_object) {
        ret_object = NULL;
        goto fail;
    }

    ret_object = J4A_NewGlobalRef__catchAll(env, local_object);
    if (!ret_object) {
        ret_object = NULL;
        goto fail;
    }

fail:
    J4A_DeleteLocalRef__p(env, &local_object);
    return ret_object;
}

jobject J4AC_ohos_media_audio_AudioStreamInfo__Builder__audioStreamFlag(JNIEnv *env, jobject thiz, jobject flag)
{
    return (*env)->CallObjectMethod(env, thiz, class_J4AC_ohos_media_audio_AudioStreamInfo__Builder.method_audioStreamFlag, flag);
}

jobject J4AC_ohos_media_audio_AudioStreamInfo__Builder__audioStreamFlag__catchAll(JNIEnv *env, jobject thiz, jobject flag)
{
    jobject ret_object = J4AC_ohos_media_audio_AudioStreamInfo__Builder__audioStreamFlag(env, thiz, flag);
    if (J4A_ExceptionCheck__catchAll(env) || !ret_object) {
        return NULL;
    }

    return ret_object;
}

jobject J4AC_ohos_media_audio_AudioStreamInfo__Builder__audioStreamFlag__asGlobalRef__catchAll(JNIEnv *env, jobject thiz, jobject flag)
{
    jobject ret_object   = NULL;
    jobject local_object = J4AC_ohos_media_audio_AudioStreamInfo__Builder__audioStreamFlag__catchAll(env, thiz, flag);
    if (J4A_ExceptionCheck__catchAll(env) || !local_object) {
        ret_object = NULL;
        goto fail;
    }

    ret_object = J4A_NewGlobalRef__catchAll(env, local_object);
    if (!ret_object) {
        ret_object = NULL;
        goto fail;
    }

fail:
    J4A_DeleteLocalRef__p(env, &local_object);
    return ret_object;
}

jobject J4AC_ohos_media_audio_AudioStreamInfo__Builder__build(JNIEnv *env, jobject thiz)
{
    return (*env)->CallObjectMethod(env, thiz, class_J4AC_ohos_media_audio_AudioStreamInfo__Builder.method_build);
}

jobject J4AC_ohos_media_audio_AudioStreamInfo__Builder__build__catchAll(JNIEnv *env, jobject thiz)
{
    jobject ret_object = J4AC_ohos_media_audio_AudioStreamInfo__Builder__build(env, thiz);
    if (J4A_ExceptionCheck__catchAll(env) || !ret_object) {
        return NULL;
    }

    return ret_object;
}

jobject J4AC_ohos_media_audio_AudioStreamInfo__Builder__build__asGlobalRef__catchAll(JNIEnv *env, jobject thiz)
{
    jobject ret_object   = NULL;
    jobject local_object = J4AC_ohos_media_audio_AudioStreamInfo__Builder__build__catchAll(env, thiz);
    if (J4A_ExceptionCheck__catchAll(env) || !local_object) {
        ret_object = NULL;
        goto fail;
    }

    ret_object = J4A_NewGlobalRef__catchAll(env, local_object);
    if (!ret_object) {
        ret_object = NULL;
        goto fail;
    }

fail:
    J4A_DeleteLocalRef__p(env, &local_object);
    return ret_object;
}

int J4A_loadClass__J4AC_ohos_media_audio_AudioStreamInfo__Builder(JNIEnv *env)
{

    int         ret                   = -1;
    const char *J4A_UNUSED(name)      = NULL;
    const char *J4A_UNUSED(sign)      = NULL;
    jclass      J4A_UNUSED(class_id)  = NULL;
    int         J4A_UNUSED(api_level) = 0;

    if (class_J4AC_ohos_media_audio_AudioStreamInfo__Builder.id != NULL)
        return 0;



    sign = "ohos/media/audio/AudioStreamInfo$Builder";
    class_J4AC_ohos_media_audio_AudioStreamInfo__Builder.id = J4A_FindClass__asGlobalRef__catchAll(env, sign);
    if (class_J4AC_ohos_media_audio_AudioStreamInfo__Builder.id == NULL)
        goto fail;

    class_id = class_J4AC_ohos_media_audio_AudioStreamInfo__Builder.id;
    name     = "<init>";
    sign     = "()V";
    class_J4AC_ohos_media_audio_AudioStreamInfo__Builder.constructor_Builder = J4A_GetMethodID__catchAll(env, class_id, name, sign);
    if (class_J4AC_ohos_media_audio_AudioStreamInfo__Builder.constructor_Builder == NULL)
        goto fail;



    class_id = class_J4AC_ohos_media_audio_AudioStreamInfo__Builder.id;
    name     = "encodingFormat";
    sign     = "(Lohos/media/audio/AudioStreamInfo$EncodingFormat;)Lohos/media/audio/AudioStreamInfo$Builder;";
    class_J4AC_ohos_media_audio_AudioStreamInfo__Builder.method_encodingFormat = J4A_GetMethodID__catchAll(env, class_id, name, sign);
    if (class_J4AC_ohos_media_audio_AudioStreamInfo__Builder.method_encodingFormat == NULL)
        goto fail;



    class_id = class_J4AC_ohos_media_audio_AudioStreamInfo__Builder.id;
    name     = "sampleRate";
    sign     = "(I)Lohos/media/audio/AudioStreamInfo$Builder;";
    class_J4AC_ohos_media_audio_AudioStreamInfo__Builder.method_sampleRate = J4A_GetMethodID__catchAll(env, class_id, name, sign);
    if (class_J4AC_ohos_media_audio_AudioStreamInfo__Builder.method_sampleRate == NULL)
        goto fail;



    class_id = class_J4AC_ohos_media_audio_AudioStreamInfo__Builder.id;
    name     = "channelMask";
    sign     = "(Lohos/media/audio/AudioStreamInfo$ChannelMask;)Lohos/media/audio/AudioStreamInfo$Builder;";
    class_J4AC_ohos_media_audio_AudioStreamInfo__Builder.method_channelMask = J4A_GetMethodID__catchAll(env, class_id, name, sign);
    if (class_J4AC_ohos_media_audio_AudioStreamInfo__Builder.method_channelMask == NULL)
        goto fail;



    class_id = class_J4AC_ohos_media_audio_AudioStreamInfo__Builder.id;
    name     = "streamUsage";
    sign     = "(Lohos/media/audio/AudioStreamInfo$StreamUsage;)Lohos/media/audio/AudioStreamInfo$Builder;";
    class_J4AC_ohos_media_audio_AudioStreamInfo__Builder.method_streamUsage = J4A_GetMethodID__catchAll(env, class_id, name, sign);
    if (class_J4AC_ohos_media_audio_AudioStreamInfo__Builder.method_streamUsage == NULL)
        goto fail;



    class_id = class_J4AC_ohos_media_audio_AudioStreamInfo__Builder.id;
    name     = "audioStreamFlag";
    sign     = "(Lohos/media/audio/AudioStreamInfo$AudioStreamFlag;)Lohos/media/audio/AudioStreamInfo$Builder;";
    class_J4AC_ohos_media_audio_AudioStreamInfo__Builder.method_audioStreamFlag = J4A_GetMethodID__catchAll(env, class_id, name, sign);
    if (class_J4AC_ohos_media_audio_AudioStreamInfo__Builder.method_audioStreamFlag == NULL)
        goto fail;



    class_id = class_J4AC_ohos_media_audio_AudioStreamInfo__Builder.id;
    name     = "build";
    sign     = "()Lohos/media/audio/AudioStreamInfo;";
    class_J4AC_ohos_media_audio_AudioStreamInfo__Builder.method_build = J4A_GetMethodID__catchAll(env, class_id, name, sign);
    if (class_J4AC_ohos_media_audio_AudioStreamInfo__Builder.method_build == NULL)
        goto fail;



    J4A_ALOGD("J4ALoader: OK: '%s' loaded\n", "ohos.media.audio.AudioStreamInfo$Builder");
    ret = 0;
fail:
    return ret;
}

int J4A_loadClass__J4AC_ohos_media_audio_AudioStreamInfo(JNIEnv *env)
{

    int         ret                   = -1;
    const char *J4A_UNUSED(name)      = NULL;
    const char *J4A_UNUSED(sign)      = NULL;
    jclass      J4A_UNUSED(class_id)  = NULL;
    int         J4A_UNUSED(api_level) = 0;

    if (class_J4AC_ohos_media_audio_AudioStreamInfo.id != NULL)
        return 0;

    sign = "ohos/media/audio/AudioStreamInfo";
    class_J4AC_ohos_media_audio_AudioStreamInfo.id = J4A_FindClass__asGlobalRef__catchAll(env, sign);
    if (class_J4AC_ohos_media_audio_AudioStreamInfo.id == NULL)
        goto fail;

    ret = J4A_loadClass__J4AC_ohos_media_audio_AudioStreamInfo__Builder(env);
    if (ret)
        goto fail;

    J4A_ALOGD("J4ALoader: OK: '%s' loaded\n", "ohos.media.audio.AudioStreamInfo");
    ret = 0;

fail:
    return ret;
}
